InterSLIP includes a script interpreter compatible with the one used by AppleTalk Remote Access (ARA), with a few extensions. You can use ARA dialing scripts with InterSLIP, although they turn off any compression in the modem. This results in the fastest response time for interactive traffic but may not result in the greatest overall transfer rate for applications such as FTP or Gopher.
To use an ARA dialing script:
1. Place a copy of the ARA dialing script in the Dialing Scripts subfolder of the InterSLIP Folder.
Connection Control Language (CCL) Quick Reference
This section provides a quick overview of CCL. For detailed information, consult the AppleTalk Remote Access Modem Developer's Guide.
A script in CCL is a text file consisting of a series of statements, one to a line. There are three kinds of statement: comments, labels, and commands.
A comment begins with an exclamation mark (!) and continues until the end of the line. Comments are ignored by InterSLIP.
A label begins with an at sign (@) and continues until the end of the line. A label denotes a point in the script that can be the target of a jump from another part of the script. There are two kinds of labels:
Symbolic labels: @ followed by a word
Numeric labels: @label followed by a number
A command starts with a word (the command name) and is followed by arguments on the rest of the line.
Configuration Parameters
Each script has a set of ten configuration parameters that can be used by the script and substituted into other strings with the notation ^n, where n is a digit from 0 to 9. The parameters are set up as follows:
0 The text from the input stream that triggered the most recent match
1 The phone number to dial
2 0 if the speaker should be off while dialing, 1 if it should be on
3 T if tone dialing, P if pulse
4 The modem initialization string specified in InterSLIP Setup
5 The gateway user name
6 The gateway password
7 The IP address specified in InterSLIP Setup, if any
8 Y if RFC 1144 header compression has been specified in InterSLIP Setup
9 The MTU size specified in InterSLIP Setup
Command Descriptions
Serial Port Control
DTRset
Asserts Data Terminal Ready.
DTRclear
Negates Data Terminal Ready.
SBreak
Sends a break.
SerReset speed, parity, databits, stopbits
Sets the speed and data format. Parity can be 0 for no parity, 1 for odd parity, and 2
for even parity.
SetSpeed speed
Sets the speed.
Write string
Sends the context of the string out the serial port.
CommunicatingAt speed
Sets the logical speed of communication, even if the serial port is locked to a higher
speed.
HSReset f1 f2 f3 f4 f5 f6
Sets the handshaking mode; generally, all arguments are zero except for f2,
which turns on hardware handshaking if set to 1.
Flow of Control within the Script
Jump label
Jumps to the specified label, which can be a number or the name of a symbolic label.
Pause n
Pauses for n 60ths of a second.
Exit code
Exits the script. An exit code of 0 denotes success; any nonzero numeric value
denotes failure.
IfAnswer label
If the script is executing in answer mode (currently not used by InterSLIP), jump to
the specified label.
IfOriginate label
If the script is executing in originate mode, jump to the specified label.
IfHangup label
If the script is executing in hangup mode, jump to the specified label.
IfStr n label string
If configuration parameter n is equal to the string, jump to the specified label.
Iteration
SetTries n
Sets the current "try" counter to n.
IncTries
Increments the "try" counter by 1.
DecTries
Decrements the "try" counter by 1.
IfTries n label
If the current try counter is equal to n, jump to the specified label.
User Notification
Note string
Displays the string as a status message (if InterSLIP Setup is running).
Sound
Plays the current system beep.
Sound name
Plays the sound resource with the specified name.
UserHook n
Ignored (included for compatibility with AppleTalk Remote Access scripts).
Pattern Matching
MatchRead n
Wait for n ticks (60ths of a second), watching the incoming data for anything that
matches a currently active pattern buffer. If a match is found, jump to the associated
label.
MatchClr
Clears the pattern buffers.
MatchStr n label pattern
Sets pattern buffer n to the specified pattern (a literal string) associated with
the specified label.
MatchExp n label pattern
Sets pattern buffer n to the specified pattern (a Unix-style regular expression)
associated with the specified label. When a match occurs, the actual data that
matched the expression can be found in configuration parameter 0.
IP Parameters
SetIP string
Sets the IP address to the contents of the string. This is most useful when a regular
expression pattern has found a match and you want to retrieve the data with something
similar to SetIP "^0"
SetMTU string
Sets the current MTU size to the contents of the string.
Gateway Scripts
Gateway scripts use the same CCL language as dialing scripts.
To install a gateway script:
1. Place a copy in the Gateway Scripts Folder inside of the InterSLIP Folder. The
gateway name appears in the Gateway pop-up menu in the InterSLIP Configuration
dialog.
Sample Gateway Script
The following gateway script logs in to a Cisco‚Ñ¢ terminal server and picks up an IP address assigned by the server for that particular session.
!
! InterSLIP gateway script for Cisco terminal server
!
! Label 99 is the general purpose error handler, which beeps
! and pauses long enough for the user to read the message.
!
! First, we wait for the user name prompt
!
@originate
note "Waiting for prompt"
matchclr
matchstr 1 1 "Username: "
matchread 50
note "No username prompt"
jump 99
!
! Now, send the user name and wait for the password prompt
!
@label 1
note "Sending user name"
write "^5\13"
matchclr
matchstr 1 2 "Password:"
matchread 50
note "No password prompt"
jump 99
!
! Send the password and wait for either the terminal server
! prompt or an error message
!
@label 2
note "Sending password"
write "^6\13"
matchclr
matchstr 1 4 ">"
matchstr 2 3 "Access denied"
matchread 120
jump 99
!
! If we got an error message, notify the user and fail
!
@label 3
note "Access Denied"
!
! General purpose error handler. Let the message appear,
! beep, and then pause for a second.
!
@label 99
pause 1
sound
pause 60
exit -1
!
! If we've successfully logged in, ask for SLIP mode and
! wait for the response. If we get anything except
! "Entering SLIP mode.", assume something went wrong, and fail.
!
@label 4
note "Requesting SLIP"
write "slip\13"
matchclr
matchstr 1 5 "Entering SLIP mode."
matchread 120
note "Cannot invoke SLIP mode"
jump 99
!
! We've entered SLIP mode, so match on the first thing that
! looks like an IP address. If we don't find one, fail.